﻿using System.ServiceModel;

namespace Metro.Kashikoi.ServiceContract.Location
{
    /// <summary>
    /// WCF client of the <c>ILocationService</c>.
    /// </summary>
    public class LocationServiceClient : ClientBase<ILocationService>, ILocationService
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceClient"/> class.
        /// </summary>
        public LocationServiceClient() :
            base("location")
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceClient"/> class.
        /// </summary>
        /// <param name="remoteAddress">The remote address.</param>
        public LocationServiceClient(string remoteAddress) :
            base("location", remoteAddress)
        {
        }

        #endregion

        #region ILocationService Members

        /// <summary>
        /// Creates the organization.
        /// </summary>
        /// <param name="organization">The organization.</param>
        /// <returns>
        /// The newly created organization.
        /// </returns>
        public Organization CreateOrganization(Organization organization)
        {
            return base.Channel.CreateOrganization(organization);
        }

        /// <summary>
        /// Updates the organization.
        /// </summary>
        /// <param name="organization">The organization.</param>
        public void UpdateOrganization(Organization organization)
        {
            base.Channel.UpdateOrganization(organization);
        }

        /// <summary>
        /// Deleles the organization.
        /// </summary>
        /// <param name="organizationId">The organization id.</param>
        public void DeleleOrganization(int organizationId)
        {
            base.Channel.DeleleOrganization(organizationId);
        }

        /// <summary>
        /// Gets the default organization.
        /// </summary>
        /// <returns>
        /// The default organization.
        /// </returns>
        public Organization GetDefaultOrganization()
        {
            return base.Channel.GetDefaultOrganization();
        }

        /// <summary>
        /// Gets the organization.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>
        /// The organization with the specific name.
        /// </returns>
        public Organization GetOrganization(string name)
        {
            return base.Channel.GetOrganization(name);
        }

        /// <summary>
        /// Creates the facility.
        /// </summary>
        /// <param name="facility">The facility.</param>
        /// <param name="organizationId">The organization id.</param>
        /// <returns>
        /// The newly created facility.
        /// </returns>
        public Facility CreateFacility(Facility facility, int organizationId)
        {
            return base.Channel.CreateFacility(facility, organizationId);
        }

        /// <summary>
        /// Updates the facility.
        /// </summary>
        /// <param name="facility">The facility.</param>
        public void UpdateFacility(Facility facility)
        {
            base.Channel.UpdateFacility(facility);
        }

        /// <summary>
        /// Deletes the facility.
        /// </summary>
        /// <param name="facilityId">The facility id.</param>
        public void DeleteFacility(int facilityId)
        {
            base.Channel.DeleteFacility(facilityId);
        }

        /// <summary>
        /// Creates the unit.
        /// </summary>
        /// <param name="unit">The unit.</param>
        /// <param name="facilityId">The facility id.</param>
        /// <returns>
        /// The newly created unit.
        /// </returns>
        public Unit CreateUnit(Unit unit, int facilityId)
        {
            return base.Channel.CreateUnit(unit, facilityId);
        }

        /// <summary>
        /// Updates the unit.
        /// </summary>
        /// <param name="unit">The unit.</param>
        public void UpdateUnit(Unit unit)
        {
            base.Channel.UpdateUnit(unit);
        }

        /// <summary>
        /// Deletes the unit.
        /// </summary>
        /// <param name="unitId">The unit id.</param>
        public void DeleteUnit(int unitId)
        {
            base.Channel.DeleteUnit(unitId);
        }

        /// <summary>
        /// Creates the stock area.
        /// </summary>
        /// <param name="stockArea">The stock area.</param>
        /// <param name="unitId">The unit id.</param>
        /// <returns>
        /// The newly created stock area.
        /// </returns>
        public StockArea CreateStockArea(StockArea stockArea, int unitId)
        {
            return base.Channel.CreateStockArea(stockArea, unitId);
        }

        /// <summary>
        /// Updates the stock area.
        /// </summary>
        /// <param name="stockArea">The stock area.</param>
        public void UpdateStockArea(StockArea stockArea)
        {
            base.Channel.UpdateStockArea(stockArea);
        }

        /// <summary>
        /// Deletes the stock area.
        /// </summary>
        /// <param name="stockAreaId">The stock area id.</param>
        public void DeleteStockArea(int stockAreaId)
        {
            base.Channel.DeleteStockArea(stockAreaId);
        }

        /// <summary>
        /// Gets the stock area.
        /// </summary>
        /// <param name="stockAreaId">The stock area id.</param>
        /// <returns>The stock area.</returns>
        public StockArea GetStockArea(int stockAreaId)
        {
            return base.Channel.GetStockArea(stockAreaId);
        }

        #endregion

    }
}